/**
 * 
 */
package sk.stuba.fiit.foo07.genex.dao;

import java.sql.SQLException;
import java.util.ArrayList;

import sk.stuba.fiit.foo07.genex.beans.Picture;
import sk.stuba.fiit.foo07.genex.exceptions.PictureInPictureQuestionException;

/**
 * @author _mizu_
 * 
 */
public interface PictureDao {

    /**
     * Method for getting a picture.
     * 
     * @param pictureID
     *                id of picture
     * 
     * @return picutre
     * 
     */

    public Picture getPictureByID(Integer pictureID) throws SQLException;

    /**
     * Method for verifying whether there exists a picutre witha given name.
     * 
     * @param name
     *                name of picture
     * 
     * @return boolean
     * 
     */
    public boolean existsPictureByName(String name) throws SQLException;

    /**
     * Method for getting pictures in test.
     * 
     * @param testID
     *                id of test
     * 
     * @return list of pictures
     * 
     */
    public ArrayList<Picture> getPicturesByTestID(Integer testID)
            throws SQLException;

    /**
     * Method for getting all pictures.
     * 
     * 
     * @return list of all pictures
     * 
     */
    public ArrayList<Picture> getAllPictures() throws SQLException;

    /**
     * Method for getting pictures in question.
     * 
     * @param QuestionID
     *                id of question
     * 
     * @return list of pictures
     * 
     */
    public ArrayList<Picture> getPicturesByQuestionID(Integer QuestionID)
            throws SQLException;

    /**
     * Method for adding a picture in database.
     * 
     * @param toAdd
     *                picture to add
     * 
     * 
     * 
     */
    public void addPicture(Picture toAdd) throws SQLException;

    /**
     * Method for adding pictures into database.
     * 
     * @param toAdd
     *                lst of pictures to add
     * 
     * 
     * 
     */
    public void addPictures(ArrayList<Picture> toAdd) throws SQLException;

    /**
     * Method for adding Pictures To a question.
     * 
     * @param pictureId
     *                id of picture to add
     * @param questionId
     *                id of question where to add the picture
     * @return answer
     * 
     */
    public void addPictureToQuestion(Integer pictureId, Integer questionId)
            throws SQLException;

    /**
     * Method for removing Pictures from a question.
     * 
     * @param pictureId
     *                id of picture to add
     * @param questionId
     *                id of question where to delete the picture
     * @return answer
     * 
     */

    public void deletePictureFromQuestion(Integer pictureId, Integer questionId)
            throws SQLException;

    /**
     * Method for deleting pictures from database.
     * 
     * @param toDelete
     *                id of picture to remove
     * 
     * 
     * 
     */
    public void deletePicture(Picture toDelete)
            throws PictureInPictureQuestionException, SQLException;

    /**
     * Method for deleting pictures from database.
     * 
     * @param toDelete
     *                id of pictures to delete
     * 
     * 
     * 
     */
    public void deletePictures(ArrayList<Picture> toDelete)
            throws PictureInPictureQuestionException, SQLException;

    /**
     * Method for updating pictures.
     * 
     * @param toUpdate
     *                picture to update
     * 
     * 
     * 
     */
    public void updatePicture(Picture toUpdate) throws SQLException;
}
